﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="OperatorRegistration.ascx.cs"
    Inherits="OperatorRegistration" %>
<span class="failureNotification">
    <asp:Literal ID="ErrorMessage" runat="server"></asp:Literal>
</span>
<asp:ValidationSummary ID="RegisterUserValidationSummary" runat="server" CssClass="failureNotification"
    ValidationGroup="RegisterUserValidationGroup" />
<br />
<table>
    <tr class="otstup">
        <td >
            <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">Логин:</asp:Label>
        </td>
        <td >
            <asp:TextBox ID="UserName" MaxLength="20" runat="server" CssClass="textEntry"></asp:TextBox>
            </td>
            <td>
            <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                CssClass="failureNotification" Display="Dynamic" ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                
            <asp:RegularExpressionValidator runat="server" ID="UserNameRequired2" ControlToValidate="UserName"
                Display="Dynamic" Text="Имя пользователя сост. 2-20 лат. букв и цифры, 1-й символ буква!"
                ForeColor="Red" ValidationExpression="^[a-zA-Z][a-zA-Z0-9-_\.]{1,20}$" ValidationGroup="RegisterUserValidationGroup" />
               
        </td>
    </tr>
 
    <tr class="otstup">
        <td >
            <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">E-mail:</asp:Label>
        </td>
        <td>
            <asp:TextBox ID="Email" MaxLength="30" runat="server" CssClass="textEntry"></asp:TextBox>
            <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email"
                CssClass="failureNotification" ToolTip="E-mail is required." ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
        </td>
        <td>
            <asp:RegularExpressionValidator ID="OperatorRegEmail" ControlToValidate="Email" Text="Неправильный формат записи Email. Повторите ввод."
                ForeColor="Red" ValidationExpression="^[-\w.]+@([A-z0-9][-A-z0-9]+\.)+[A-z]{2,4}$"
                runat="server" ValidationGroup="RegisterUserValidationGroup" />
        </td>
    </tr>
    <tr class="otstup">
        <td>
            <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Пароль:</asp:Label>
        </td>
        <td>
            <asp:TextBox ID="Password" MaxLength="30" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
            <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                CssClass="failureNotification" ToolTip="Password is required." ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
        </td>
        <td>
            <asp:RegularExpressionValidator ID="OperatorPasswordValidator" ControlToValidate="Password"
                Text="Пароль должен состоять из цифр и букв латинского алфавита (6,20)" ForeColor="Red"
                ValidationExpression="(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{6,20})$" runat="server"
                ValidationGroup="RegisterUserValidationGroup" />
        </td>
    </tr>
    <tr class="otstup">
        <td>
            <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">Подтвердите пароль:</asp:Label>
        </td>
        <td>
            <asp:TextBox ID="ConfirmPassword" MaxLength="30" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
            <asp:RequiredFieldValidator ControlToValidate="ConfirmPassword" CssClass="failureNotification"
                Display="Dynamic" ID="ConfirmPasswordRequired" runat="server" ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
            <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password"
                ControlToValidate="ConfirmPassword" CssClass="failureNotification" Display="Dynamic"
                ValidationGroup="RegisterUserValidationGroup">*</asp:CompareValidator>
        </td>
        <td>
            <asp:RegularExpressionValidator ID="OperatorPasswordCompareValidator" ControlToValidate="Password"
                Text="" ForeColor="Red" ValidationExpression="(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{6,20})$"
                runat="server" ValidationGroup="RegisterUserValidationGroup" />
        </td>
        <tr>
            <td>
            </td>
            <td>
                <asp:Button ID="ResetPassword" runat="server" Text="Сбросить пароль" OnClick="ResetPassword_Click"
                    Visible="False" /><br />
            </td>
        </tr>
        <tr class="otstup">
            <td>
                <asp:Label ID="NameLabel" runat="server" AssociatedControlID="OperatorName">Ф.И.О:</asp:Label>
            </td>
            <td>
                <asp:TextBox ID="OperatorName" MaxLength="50" runat="server" CssClass="textEntry"></asp:TextBox>
                <asp:RequiredFieldValidator ControlToValidate="OperatorName" CssClass="failureNotification"
                    Display="Dynamic" ID="RequiredFieldValidator1" runat="server" ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                    </td>
                    <td>
                <asp:RegularExpressionValidator ID="OperatorNameValidator" ControlToValidate="OperatorName"
                    Text="Неправильный формат записи ФИО" ForeColor="Red" ValidationExpression="^[А-ЯЁ][а-яё]{1,}(([ ]|[-])([А-ЯЁ]|[а-яё]){1}[а-яё]{1,})*$"
                    runat="server" ValidationGroup="RegisterUserValidationGroup" />
            </td>
        </tr>
        <tr class="otstup">
            <td>
            </td>
            <td>
                <asp:Button ID="CreateUserButton" runat="server" CommandName="MoveNext" Text="Create User"
                    ValidationGroup="RegisterUserValidationGroup" OnClick="CreateUserButton_Click" />
                <asp:Label ID="ErrorLabel" runat="server" Text=""></asp:Label>
            </td>
        </tr>
</table>
